<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/14 0014
 * Time: 17:12
 */
namespace app\admin\controller;

use app\admin\controller\Base;
use think\Db;
use app\common\logic\AdminLogic;

class System extends Base {

    public function login() {
        if ($this->request->isPost()) {
            //登录提交
            $input = input('post.');
            $login = new AdminLogic();
            $result = $login->login($input);
            $this->result('', $result['code'], $result['msg']);
            exit();
        }
        return $this->fetch();
    }

    /**
     * 退出系统
     */
    public function logout() {
        $login = new AdminLogic();
        $login->logout();
        $this->redirect('system/login');
    }
}
